﻿using SwenAssigment.Classes;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SwenAssigment
{
    public partial class BookingSearch : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["mystat"] != null)
            {
                Label1.Text = Session["mystat"].ToString();
                Label1.Visible = true;
                Session["mystat"] = null;
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string temp = " and Room_Assigned='" + DropDownList2.Text + "'";
            if (DropDownList2.Text == "All")
            {
                temp = null;
            }
            string temp2 = "";
            if (DropDownList1.Text == "In hotel")
            {
                temp2 = "In";
            }
            else
            {
                temp2 = "Out";
            }
            string s = "select * from Room_Booking where Additional_Remarks='" + temp2 + "'" + temp;
            RADcon con = new RADcon();
            ArrayList al = con.bretrieve(s);
            GridView1.DataSource = al;
            GridView1.DataBind();
        }
    }
}